package com.cskaoyan.module.vo;

import com.cskaoyan.module.pojo.MarketCoupon;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 "total": 4,
 "pages": 1,
 "limit": 20,
 "page": 1,
 "list": [{
 * @2022/4/6
 **/

@NoArgsConstructor
@Data
@AllArgsConstructor
public class MarketCouponVo {

    @JsonProperty("total")
    private Long total;
    @JsonProperty("pages")
    private Integer pages;
    @JsonProperty("limit")
    private Integer limit;
    @JsonProperty("page")
    private Integer page;
    @JsonProperty("list")
    private List<ListDTO> list;

    @Override
    public String toString() {
        return "{" +
                "total=" + total +
                ", pages=" + pages +
                ", limit=" + limit +
                ", page=" + page +
                ", list=" + list +
                '}';
    }

    @NoArgsConstructor
    @Data
    public static class ListDTO {
        @JsonProperty("id")
        private Integer id;
        @JsonProperty("name")
        private String name;
        @JsonProperty("desc")
        private String desc;
        @JsonProperty("tag")
        private String tag;
        @JsonProperty("total")
        private Integer total;
        @JsonProperty("discount")
        private BigDecimal discount;
        @JsonProperty("min")
        private BigDecimal min;
        @JsonProperty("limit")
        private Integer limit;
        @JsonProperty("type")
        private Integer type;
        @JsonProperty("status")
        private Integer status;
        @JsonProperty("goodsType")
        private Integer goodsType;
        @JsonProperty("goodsValue")
        private Integer[] goodsValue;
        @JsonProperty("timeType")
        private Integer timeType;
        @JsonProperty("days")
        private Integer days;
        @JsonProperty("addTime")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date addTime;
        @JsonProperty("updateTime")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date updateTime;
        @JsonProperty("deleted")
        private Boolean deleted;

        @Override
        public String toString() {
            return "{" +
                    "id=" + id +
                    ", name='" + name + '\'' +
                    ", desc='" + desc + '\'' +
                    ", tag='" + tag + '\'' +
                    ", total=" + total +
                    ", discount=" + discount +
                    ", min=" + min +
                    ", limit=" + limit +
                    ", type=" + type +
                    ", status=" + status +
                    ", goodsType=" + goodsType +
                    ", goodsValue=" + Arrays.toString(goodsValue) +
                    ", timeType=" + timeType +
                    ", days=" + days +
                    ", addTime=" + addTime +
                    ", updateTime=" + updateTime +
                    ", deleted=" + deleted +
                    '}';
        }
    }

}
